package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.anno.AutoFill;
import com.sky.anno.OperationType;
import com.sky.dto.EmployeePageQueryDTO;
import com.sky.entity.Employee;
import org.apache.ibatis.annotations.Mapper;

/**
 * @author wangqi
 * @date 2023/12/25 15:12
 */
@Mapper
public interface EmployeeMapper {
    public Employee findEmployeeByUsername(String username);

    Employee findEmployeeByPasswordAndId(String oldPassword, Long empId);

    void updatePassword(Long empId, String newPassword);

    @AutoFill(OperationType.INSERT)
    void insert(Employee employee);

    Page<Employee> pageQuery(EmployeePageQueryDTO employeePageQueryDTO);

    @AutoFill(OperationType.UPDATE)
    void update(Employee employee);

    Employee findEmployeeById(Long id);
}
